const http = require('http');
const port = 3000;

const server = http.createServer((req, res) => {
    if (req.url.startsWith('/login')) {
        const username = req.url.split('?')[1].split('=')[1].split('&')[0];
        const password = req.url.split('&')[1].split('=')[1];
        console.log(`当前登录用户名为：${username},密码为：${password}`);
        res.end('登录成功');
    }
})

server.listen(port, () => {
    console.log(`服务器启动成功在 http://localhost:${port}`);

})